package com.zuihai.app.mvp.ui.adapter;

import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.zuihai.app.R;
import com.zuihai.app.mvp.model.entity.BackgroundResult;
import com.zuihai.app.mvp.ui.holder.BackgroundHolder;
import com.zuihai.app.mvp.ui.holder.BaseViewHolderWraper;

import java.util.List;

/**
 * Created by Administrator on 2017/6/14 0014.
 */

public class BackgroundAdapter extends BaseQuickAdapter<BackgroundResult, BaseViewHolderWraper> {

    public BackgroundAdapter(List<BackgroundResult> data) {
        super(data);
    }

    @Override
    protected BaseViewHolderWraper onCreateDefViewHolder(ViewGroup parent, int viewType) {
        View itemView = LayoutInflater.from(mContext).inflate(R.layout.layout_item_background, parent, false);
        BackgroundHolder holder = new BackgroundHolder(itemView,mContext);
        return holder;
    }
    @Override
    protected void convert(BaseViewHolderWraper helper, BackgroundResult item) {
        helper.fillData(item, helper.getAdapterPosition());

    }

    @Override
    public void onDetachedFromRecyclerView(RecyclerView recyclerView) {
        super.onDetachedFromRecyclerView(recyclerView);
    }
}
